<div ng-controller="NetworkMgmtCtrl">
    <div class="row-fluid">
        <div class="span8">
            <div class="row-fluid">
                <div class="span9">
                    <div class="btn-toolbar server-btn-toolbar ui-toolbar">
                        <div class="btn-group">
                            <button type="button" class="btn btn-mini" ng-click="do_add()">添加</button>
                            <button type="button" class="btn btn-mini" ng-disabled="!selected_network"
                                    ng-click="do_edit()">修改
                            </button>
                        </div>
                        <button type="button" class="btn btn-danger btn-mini" ng-disabled="!selected_network"
                                ng-click="do_delete()">删除
                        </button>
                        <button type="button" class="btn btn-mini" ng-hide="!show_fixedip()"
                                ng-click="do_fixedip()">ip管理
                        </button>
                    </div>
                </div>
                <div class="span3">
                    <span>每页显示</span>
                    <select class="input-mini" ng-model="page_size" ng-options="pz for pz in page_sizes"
                            ng-change="change(page_size)"></select>
                    <span>条</span>
                </div>
            </div>
            <table class="table table-bordered table-condensed" tableorder="networks">
                <thead>
                <tr>
                    <th by='name'>名称</th>
                    <th by='networktype'>类型</th>
                    <th>IP段</th>
                    <th>DHCP</th>
                    <th>DHCP开始</th>
                    <th>DHCP结束</th>
                    <th>关联网卡</th>
                    <th>关联集群</th>

                </tr>
                </thead>
                <tbody>
                <tr selectable='network' exclusive ng-repeat="network in networks | activeitem |orderBy:orderfield:reverse"
                    ng-click="show_details()">
                    <td>{{ network.name }}</td>
                    <td>{{ network.networktype |network_type }}</td>
                    <td>{{ network.cidr }}</td>
                    <td>{{ network.rundhcp | yesorno }}</td>
                    <td>{{ network.dhcp_start }}</td>
                    <td>{{ network.dhcp_end }}</td>
                    <td>
                            {{ network.interface_set.length }}
                    </td>
                    <td>{{ network.cluster.name }}</td>


                </tr>
                </tbody>
            </table>
            <div class="pagination">
                <ul>
                    <li ng-hide="should_hide()" ng-class="prev_class" ng-click="prev()"><a href="javascript:void(0);">上一页</a>
                    </li>
                    <li ng-repeat="i in [] | range:page_count()" ng-hide="should_hide()" ng-click="page(i)"
                        ng-class="(i == current_page) && 'active'">
                        <a href="javascript:void(0)">{{ i + 1}}</a>
                    </li>
                    <li ng-hide="should_hide()" ng-class="next_class" ng-click="next()"><a href="javascript:void(0);">下一页</a>
                    </li>
                </ul>
            </div>

        </div>
        <div class="span4"
             ng-show="(selected_network.networktype==2||selected_network.networktype==3)&&selected_network.rundhcp">
            <div class="well">
                <div class="row-fluid ">
                    <div class="span2">网关:</div>
                    <div class="span4"><span class=" label label-success">{{ selected_network.gateway }}</span></div>
                    <div class="span2">dns1:</div>
                    <div class="span4"><span class=" label label-success">{{ selected_network.dns1 }}</span></div>

                </div>
                <div class="row-fluid ">
                    <div class="span2">dns2:</div>
                    <div class="span4"><span class=" label label-success">{{ selected_network.dns2 }}</span></div>
                    <div class="span2" ng-show="selected_network.networktype==3">VLAN ID:</div>
                    <div class="span4" ng-show="selected_network.networktype==3"><span
                            class=" label label-success">{{ selected_network.vlanid }}</span></div>
                </div>
            </div>

        </div>

    </div>


</div>